package com.example.pan.model

import com.example.pan.ui.formatBit


data class AccountInfo(
    val token: String,
    val userInfo: UserInfo,
    val quota: Quota
)

data class UserInfo(
    val request_id: String,
    val errno: Int,
    val errmsg: String,
    val avatar_url: String,
    val baidu_name: String,
    val netdisk_name: String,
    val vip_type: Int,
    val uk: Int
)


data class Quota(
    val errno: Int,
    val used: Long,
    val total: Long,
    val request_id: Long
) {

    fun getUsed(): String = formatBit(used)

    fun getTotal(): String = formatBit(total)

    fun getPercent(): Int = (used.toDouble() / total.toDouble() * 100).toInt()

}